<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
	$(function(){
		$("#chkToggle").click(function(){
			var elements = $("form :checkbox");
			if(this.checked){
				elements.each(function(element){
					this.checked = true;
					document.forms[0].hndBoxChecked.value ++;
				});
			}else{
				elements.each(function(element){
					this.checked = false;
				});
				document.forms[0].hndBoxChecked.value = 0;
			}
		});
			$("#lnkSave").click(function(){
			$('#adminForm').submit();
		});
		
		$("#lnkDelete").click(function(){
			var form = document.adminForm;
			if(form.hndBoxChecked.value==0){
				alert('Bạn phải chọn một hóa đơn  để xóa');
			}else if(confirm('Bạn có chắc muốn xóa hóa đơn này không?')){
				form.action = '<?php echo DOMAIN?>/hoa_don/delete';
				form.submit();
			}
		});
		
	$("#lnkClose").click(function(){
			window.location = '<?php echo DOMAIN?>/home';
		});
		$("#btnFilter").click(function(){
			document.adminForm.submit();
		});

		$("#btnReset").click(function(){
			$("#hndResetFilter").val(1);
			document.adminForm.submit();
		});
	});

	function isChecked(checkObject){
		if (checkObject.checked == true){
			document.adminForm.hndBoxChecked.value ++;
		}else {
			document.adminForm.hndBoxChecked.value --;
		}
	}

	function getSelectedID(){
		var IDs = "";
		$('input[name=chkID]:checkbox').each(function(){
			if(this.checked){
				if(IDs.isEmpty()){
					IDs = this.value;
				}else{
					IDs += "|" + this.value;
				}
			}
		});
		return IDs;
	}
/*]]>*/
</script>
 <script type="text/javascript">
    $(document).ready(function()
		{
            //Activate the main dynamic form  
				
			$("#invoice").dynamicForm("#plus7", "#minus7", {limit:5,createColor:"FFFFFF"});                       	
			
          });
</script> 	
<div id="content-box">
	<div class="border">
		<div class="padding">
			<div id="toolbar-box">
				<div class="t"><div class="t"><div class="t"></div></div></div>
				<div class="m">
				<div class="toolbar" id="toolbar">
				<table class="toolbar" summary="">
				<tr>
                	<td class="button" id="toolbar-save">
					<a href="javascript:;//Cập nhật" id="lnkSave" class="toolbar">
						<span class="icon-32-save" title="Cập nhật"></span>
						Cập nhật
					</a>
					</td>
               		<td class="button" id="toolbar-cancel">
                        <a href="javascript:;//Đóng" id="lnkClose" class="toolbar">
                            <span class="icon-32-cancel" title="Đóng"></span>
                            Đóng
                        </a>
					</td>
				</tr>
				</table>
				</div>
				<div class="header icon-48-langmanager">Quản Tạo hóa đơn</div>
				<div class="clr"></div>
			</div>
			<div class="b"><div class="b"><div class="b"></div></div></div>
  		</div>
   		<div class="clr"></div>
		<div id="element-box">
			<div class="t"><div class="t"><div class="t"></div></div></div>
			<div class="m">
			<form action="<?php echo DOMAIN?>/invoices/add" method="post" name="adminForm" id="adminForm">
			<table class="adminlist" cellpadding="1" summary="">
			<thead>
				<tr>
					
					
					<th class="title">
						Tên sản phẩm
					</th>
                    
					<th width="15%" class="title" >
						Mã sản phẩm
					</th>
                    <th class="title" >
						Giá sản phẩm (VNĐ)
					</th>
					<th class="title" >
						Số lượng
					</th>
					
				
					 <th class="title" nowrap="nowrap">
						<span style="float:left;">Tài khoản người mua</span>
                         <span style="clear:none; float:right;">
                         <a id="minus7" href="" style="color: rgb(37, 170, 226); display: none;">[-]</a>
                         <a id="plus7" href="" style="color: rgb(37, 170, 226);">[+]</a>
                    </span>
					</th>
				</tr>
			</thead>
		
			<tbody>
				
				<tr class="row0" id="invoice"  height="28">
					<td width="20%"><center><input type="text" name="nameProduct" size="40" style="height:20px;" /></center></td>             
					<td width="10%"><center><input type="text" name="codeProduct" size="40" style="height:20px;"/></center></td>
                    <td width="20%"><center><input type="text" name="costProduct" size="40" style="height:20px;"/></center></td>
                    <td width="5%"><center><input type="text" name="slProduct" size="10" style="height:20px;"/></center></td>
					<td width="20%"><center><input type="text" name="userMember" size="40"  style="height:20px;"/></center></td>
         			
				</tr>
				
			</tbody>
			</table>
			
			</form>
			<div class="clr"></div>
			</div>
			<div class="b"><div class="b"><div class="b"></div></div></div>
   		</div>
		<noscript>Warning! JavaScript must be enabled for proper operation of the Administrator back-end.</noscript>
		<div class="clr"></div>
	</div>
	<div class="clr"></div>
	</div>
</div>
